import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class TestJDBC {
    public  static void main(String[] args) {
        try {
            Class.forName("com.mysql.jdbc.Driver");
            System.out.println("数据库驱动加载成功！");
            Connection c = DriverManager.getConnection(
                    "jdbc:mysql://127.0.0.1:3306/informationmanger?characterEncoding=UTF-8",
                    "root",
                    "1998"
            );
            System.out.println("连接成功, 获取连接对象：" + c);
        }
        catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
